#ifndef OBJECT_3D_H
#define OBJECT_3D_H

#include <GL/gl.h>
#include <vector>
#include <iostream>
#include <stdio.h>

#include "Mesh.h"
#include "Triangle.h"
#include "Vertex3D.h"
#include "Types.h"


using namespace std;

class Object3D : public Mesh {
		
	private :	
		
		/** State of the object defined in types.h */
		TState state;	
		/** Rotation angles around himself */
		GLdouble _rotation[3];		
		/** Traslation increment */
		GLdouble _translation[3];
		/**Indicates the actual color of the object*/
		GLfloat _color[4];
	
	public :
		Object3D ();		
		Object3D (Mesh *m);
		Object3D (Object3D &obj);
		Object3D (const char *path);
		~Object3D ();
		
		/*Import orj*/
		void importar(FILE *f,int line);
		/** \brief Draw object onto screen */
		void draw ();
		/**	\brief Changes center of mass */
		void set_com (Vertex3D v);
		/** \brief Calculates the center of mass */
		void compute_com ();

		/* TRANSFORM OPERATIONS */

		/** \brief Move object to determined position
 		 * \param pos : new position of the center of mass */ 
		void move (Vertex3D pos);	
		/** \brief Scale object 
 		 * \param factor : scale factor 
 		 * \param axis : scale the object restricted to axis */
		void scale (GLdouble factor, TAxis axis);
		/** \brief Rotate object
 		 *  \param degree : degrees to rotate
 		 *  \param axis : axis to rotate around */
		void rotate (GLdouble degree, TAxis axis); 
		/** \brief Extrude face of object
 		 * \param triang : one of the triangles that compound the face
 		 * \param dist : distance to extrude where sign determines direction */
		void extrude (Triangle *t, GLdouble dist);
};


#endif
